<?php

namespace app\admin\command;

use app\common\util\Tools;
use think\console\Input;
use think\console\Output;
use think\facade\Log;

class CarTest extends CommonTest
{

    //再命令窗口中执行“php think interface-CarTest”
    protected function configure()
    {
        $this->setName('interface-CarTest')
            ->setDescription('接口测试');
    }

    public function execute(Input $input, Output $output)
    {
        parent::execute($input, $output);

        //Route::any('admin/carType/getPageList', 'admin/car/getCarTypeList');                                                    // 车辆类型列表，分页功能
//        $data = Tools::curl($this->url . "admin/carType/getPageList", json_encode(["token" => "$this->token"]));
//        Log::write("post". var_export($data,true));
//        echo $data . "\n\n";
//
//        //Route::any('admin/carType/getDetailsById', 'admin/car/getCarTypeDetail');                                               // 车辆类型详细信息
//        $data = Tools::curl($this->url . "admin/carType/getDetailsById", json_encode(["token" => "$this->token", "id" => "1"]));
//        Log::write("post". var_export($data,true));
//        echo $data . "\n\n";
//
//        //Route::any('admin/carType/create', 'admin/car/toAddCarType');                                                           // 添加车辆类型
//        $data = Tools::curl($this->url . "admin/carType/create", json_encode(["token" => "$this->token", "name" => "保洁", "orderNumber" => "HSIFSLDFI2", "seat" => "6", "icon" => "sdf"]));
//        Log::write("post". var_export($data,true));
//        echo $data . "\n\n";

        //Route::any('admin/car/create', 'admin/car/toAddCar');                                                                   // 添加车辆
//        $data = Tools::curl($this->url . "admin/car/create", json_encode(["token" => "$this->token", "name" => "xxx", "modelNumber" => "HSIFSLDFI2", "plateNumber" => "HSIFSLDFI2", "carType" => "1", "seat" => "6", "icon" => "sdf"]));
//        Log::write("post". var_export($data,true));
//        echo $data . "\n\n";

        //Route::any('admin/car/getPageList', 'admin/car/getCarList');                                                            // 车辆列表，分页功能
//        $data = Tools::curl($this->url . "admin/car/getPageList", json_encode(["token" => "$this->token"]));
//        Log::write("post". var_export($data,true));
//        echo $data . "\n\n";

        //Route::any('admin/car/getDetailsById', 'admin/car/getCarDetail');                                                       // 车辆详细信息
//        $data = Tools::curl($this->url . "admin/car/getDetailsById", json_encode(["token" => "$this->token", "id" => 1]));
//        Log::write("post". var_export($data,true));
//        echo $data . "\n\n";

        //Route::any('admin/carType/getChoose', 'admin/car/getChooseCarType');                                                    // 挑选出所有的车辆类型
        $data = Tools::curl($this->url . "admin/carType/getChoose", json_encode(["token" => "$this->token"]));
        Log::write("post". var_export($data,true));
        echo $data . "\n\n";

    }
}
